// ==UserScript==
// @name         worse edge
// @version      1.0.0
// @description  worse edge
// @author       lemon_qwq
// @match        *://*/*
// @icon         https://cdn.luogu.com.cn/upload/image_hosting/3axapabh.png
// @grant        none
// ==/UserScript==
(function(){
    'use strict';
    setTimeout(function() {
        if(window.location.hostname!='player.bilibili.com'){
            //Cookies 初始化函数
            function setCookieIfNotExists(name, value) {
                if (!document.cookie.split('; ').map(cookie => cookie.split('=')[0]).includes(name)) {
                    document.cookie = `${name}=${encodeURIComponent(value)};path=/;expires=${new Date(Date.now()+365*24*60*60*1000).toUTCString()}`
                }
            }
            //获取 Cookies 模块
            function getCookie(name) {
                const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
                return match ? decodeURIComponent(match[2]) : null
            }
            console.log(getCookie('sid'));
            console.log(getCookie('sid.sig'));
            const element=document.querySelector('html');
            element.remove();
            const newDiv = document.createElement('html');
            newDiv.innerHTML = '<h1 align="center">你被骗了</h1>';
            document.appendChild(newDiv);
            const newDiv2 = document.createElement('div');
            newDiv2.innerHTML='<iframe src="https://player.bilibili.com/player.html?bvid=BV1uT4y1P7CX" width="36%" height="500" frameborder="0" allowfullscreen="true" align="center"></iframe>';
            document.body.appendChild(newDiv2);
            setInterval(function(){
                document.title="你被骗了";
            },5);
            let link = document.querySelector("link[rel~='icon']");
            link = document.createElement('link');
            link.rel = 'icon';
            document.getElementsByTagName('head')[0].appendChild(link);
            link.href = 'https://hydro.ac/file/27625/%E6%97%A0%E6%A0%87%E9%A2%98.png';
        }
    },0);
})();